/**
 * Copyright:Copyright(c)2014-2017
 * Company:厦门市易致达物联网科技有限公司
 * @version 1.0
 */
package shop.services.manage.searchhistory.dao.impl;

import java.util.List;

import shop.core.common.dao.BaseDao;
import shop.core.common.dao.page.PagerModel;
import shop.services.manage.searchhistory.bean.Searchhistory;
import shop.services.manage.searchhistory.dao.SearchhistoryDao;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * @类名称：SearchhistoryDaoImpl
 * @创建人：wzl
 * @创建时间：2018-05-09 下午19:32:50  
 * @版本号：1.0
 * @描述：
 */
@Repository("searchhistoryDaoManage")
public class SearchhistoryDaoImpl  implements SearchhistoryDao {

    @Resource
    private BaseDao dao;

    public void setDao(BaseDao dao) {
        this.dao = dao;
    }

    public PagerModel selectPageList(Searchhistory e) {
        return dao.selectPageList("manage.searchhistory.selectPageList","manage.searchhistory.selectPageCount", e);
    }

    public List selectList(Searchhistory e) {
        return dao.selectList("manage.searchhistory.selectList", e);
    }

    public Searchhistory selectOne(Searchhistory e) {
        return (Searchhistory) dao.selectOne("manage.searchhistory.selectOne", e);
    }

    public int delete(Searchhistory e) {
        return dao.delete("manage.searchhistory.delete", e);
    }

    public int update(Searchhistory e) {
        return dao.update("manage.searchhistory.update", e);
    }

    public int deletes(String[] ids) {
        Searchhistory e = new Searchhistory();
        for (int i = 0; i < ids.length; i++) {
            e.setId(ids[i]);
            delete(e);
        }
        return 0;
    }

    public int insert(Searchhistory e) {
        return dao.insert("manage.searchhistory.insert", e);
    }

    public int deleteById(int id) {
        return dao.delete("manage.searchhistory.deleteById", id);
    }

    @Override
    public Searchhistory selectById(String id) {
        return (Searchhistory) dao.selectOne("manage.searchhistory.selectById", id);
    }

}

